<template>
  <div class="divBox" style="padding-bottom:0;">
    <el-row :gutter="20" class="baseInfo">
      <div @click="skip1">
        <el-col v-bind="grid" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div class="acea-row row-between-wrapper">
              <div class="acea-row align-center">
                <span class="main_tit">活动订单</span>
              </div>
            </div>
            <div class="content" v-if="viewData">
              <span class="content-number spBlock my15">{{ viewData.activityOrderCount }}</span>
            </div>
          </el-card>
        </el-col>
      </div>
      <div @click="skip2">
        <el-col v-bind="grid" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div class="acea-row row-between-wrapper">
              <div class="acea-row align-center">
                <span class="main_tit">积分订单</span>
              </div>
            </div>
            <div class="content" v-if="viewData">
              <span class="content-number spBlock my15">{{ viewData.integralOrderCount }}</span>
            </div>
          </el-card>
        </el-col>
      </div>
      <div @click="skip3">
        <el-col v-bind="grid" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div class="acea-row row-between-wrapper">
              <div class="acea-row align-center">
                <span class="main_tit">商家入驻</span>
              </div>
            </div>
            <div class="content" v-if="viewData">
              <span class="content-number spBlock my15">{{ viewData.settleInCount }}</span>
            </div>
          </el-card>
        </el-col>
      </div>
      <div @click="skip4">
        <el-col v-bind="grid" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div class="acea-row row-between-wrapper">
              <div class="acea-row align-center">
                <span class="main_tit">创业数量</span>
              </div>
            </div>
            <div class="content" v-if="viewData">
              <span class="content-number spBlock my15">{{ viewData.entrepreneursCount }}</span>
            </div>
          </el-card>
        </el-col>
      </div>
      <div @click="skip5">
        <el-col v-bind="grid" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div class="acea-row row-between-wrapper">
              <div class="acea-row align-center">
                <span class="main_tit">商家数量</span>
              </div>
            </div>
            <div class="content" v-if="viewData">
              <span class="content-number spBlock my15">{{ viewData.businessCount }}</span>
            </div>
          </el-card>
        </el-col>
      </div>
      <div @click="skip6">
        <el-col v-bind="grid" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div class="acea-row row-between-wrapper">
              <div class="acea-row align-center">
                <span class="main_tit">用户数量</span>
              </div>
            </div>
            <div class="content" v-if="viewData">
              <span class="content-number spBlock my15">{{ viewData.userCount }}</span>
            </div>
          </el-card>
        </el-col>
      </div>
    </el-row>

  </div>
</template>
<script>
import {viewModelApi} from '@/api/dashboard'

export default {
  data() {
    return {
      grid: {xl: 4, lg: 4, md: 4, sm: 4, xs: 4},
      viewData: {
        activityOrderCount: null,
        integralOrderCount: null,
        settleInCount: null,
        entrepreneursCount: null,
        businessCount: null,
        userCount: null,
      },
      viewData1: {},
      filtrate: 10,
    }
  },
  methods: {
    skip1() {
      this.$router.push({name: 'BusinessOrderIndex'})
    },
    skip2() {
      this.$router.push({name: 'Order'})
    },
    skip3() {
      this.$router.push({name: 'SettleInIndex'})
    },
    skip4() {
      this.$router.push({name: 'EntrepreneursIndex'})
    },
    skip5() {
      this.$router.push({name: 'listIndex'})
    },
    skip6() {
      this.$router.push({name: 'User'})
    },
    //数据统计
    statisticsOrder() {
      viewModelApi().then(async res => {
        //后期接口调用
        this.viewData = res;
      })
    },
  }
  ,
  mounted() {
    this.statisticsOrder();
  }
}
</script>
<style scoped lang="scss">
::v-deep {
  .el-col-xl-6 {
    width: 20%;
  }
}

.ivu-mb {
  margin-bottom: 20px;
}

.up, .el-icon-caret-top {
  color: #F5222D;
  font-size: 12px;
  opacity: 1 !important;
}

.down, .el-icon-caret-bottom {
  color: #39C15B;
  font-size: 12px;
}

.main_tit {
  color: #333;
  font-size: 14px;
  font-weight: 500;
}

.content-time {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.main_badge {
  width: 30px;
  height: 30px;
  border-radius: 5px;
  margin-right: 10px;
  background: #2C90FF;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}

.my15 {
  margin: 15px 0 15px;
}

.align-center {
  align-items: center;
}

.baseInfo {
  ::v-deep .el-card__header {
    padding: 15px 20px !important;
  }
}

.content {
  &-number {
    font-size: 30px;
    font-weight: 600;
    font-family: PingFangSC-Semibold, PingFang SC;
    color: #333;
  }

  &-time {
    font-size: 14px;
    color: #333333;
    font-weight: 400;
  }
}

</style>
